home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 November / CD 1 / APC0211D1.ISO / workshop / prog / files / ActivePerl-5.6.1.633-MSWin32.msi / _8b36eb1a1e6e57e08c160ed160ba39ba < prev    next >
Encoding:
Text File  |  2002-06-17  |  2.1 KB  |  69 lines

  1. /*
  2.  * tkColor.h --
  3.  *
  4.  *    Declarations of data types and functions used by the
  5.  *    Tk color module.
  6.  *
  7.  * Copyright (c) 1996 by Sun Microsystems, Inc.
  8.  *
  9.  * See the file "license.terms" for information on usage and redistribution
  10.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11.  *
  12.  * RCS: @(#) $Id: tkColor.h,v 1.4 1998/09/14 18:23:08 stanton Exp $
  13.  */
  14.  
  15. #ifndef _TKCOLOR
  16. #define _TKCOLOR
  17.  
  18. #include "tkInt.h"
  19.  
  20. #ifdef BUILD_tk
  21. # undef TCL_STORAGE_CLASS
  22. # define TCL_STORAGE_CLASS DLLEXPORT
  23. #endif
  24.  
  25. /*
  26.  * One of the following data structures is used to keep track of
  27.  * each color that the color module has allocated from the X display
  28.  * server.
  29.  */
  30.  
  31. #define COLOR_MAGIC ((unsigned int) 0x46140277)
  32.  
  33. typedef struct TkColor {
  34.     XColor color;        /* Information about this color. */
  35.     unsigned int magic;        /* Used for quick integrity check on this
  36.                  * structure.   Must always have the
  37.                  * value COLOR_MAGIC. */
  38.     GC gc;            /* Simple gc with this color as foreground
  39.                  * color and all other fields defaulted.
  40.                  * May be None. */
  41.     Screen *screen;        /* Screen where this color is valid.  Used
  42.                  * to delete it, and to find its display. */
  43.     Colormap colormap;        /* Colormap from which this entry was
  44.                  * allocated. */
  45.     Visual *visual;             /* Visual associated with colormap. */
  46.     int refCount;        /* Number of uses of this structure. */
  47.     Tcl_HashTable *tablePtr;    /* Hash table that indexes this structure
  48.                  * (needed when deleting structure). */
  49.     Tcl_HashEntry *hashPtr;    /* Pointer to hash table entry for this
  50.                  * structure. (for use in deleting entry). */
  51. } TkColor;
  52.  
  53. /*
  54.  * Common APIs exported from all platform-specific implementations.
  55.  */
  56.  
  57. #ifndef TkpFreeColor
  58. EXTERN void        TkpFreeColor _ANSI_ARGS_((TkColor *tkColPtr));
  59. #endif
  60. EXTERN TkColor *    TkpGetColor _ANSI_ARGS_((Tk_Window tkwin,
  61.                 Tk_Uid name));
  62. EXTERN TkColor *    TkpGetColorByValue _ANSI_ARGS_((Tk_Window tkwin,
  63.                 XColor *colorPtr));
  64.  
  65. # undef TCL_STORAGE_CLASS
  66. # define TCL_STORAGE_CLASS DLLIMPORT
  67.  
  68. #endif /* _TKCOLOR */
  69.